﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

public partial class certificate : System.Web.UI.Page
{
    fdCertBLL certBLL = new fdCertBLL();
    //string strConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
    //string str;
    //SqlCommand com;

    protected void Page_Load(object sender, EventArgs e)
    {
        ((AfterLogin)this.Master).mainCategory = "ACCOUNTS";

        String custId = Session["userId"] as String;
        certBLL.custId = custId;

        DataSet fdCertInformation = certBLL.getfdCertInformation();

        this.certificate_Repeater.DataSource = fdCertInformation;
        this.certificate_Repeater.DataBind();

        ////String custID = Session["userId"] as String;

      
        //SqlConnection con = new SqlConnection(strConnString);
        //con.Open();
        //str = "select certNo, fName,lName,accountNo,accountType,DepositAmount,tenors,effectiveDate,maturityDate from FIXED_DEPOSIT";

        //com = new SqlCommand(str, con);
        //SqlDataReader reader = com.ExecuteReader();
        //reader.Read();
        //lbCertNo.Text = reader["certNo"].ToString();
        //reader.Read();
        //lbName.Text = reader["fName"].ToString();
        //reader.Read();
        //lbAccNo.Text = reader["accountNo"].ToString();
        //reader.Read();
        //lbAccType.Text = reader["accountType"].ToString();
        //reader.Read();
        //lbAmount.Text = reader["DepositAmount"].ToString();
        //reader.Read();
        //lbTenors.Text = reader["tenors"].ToString();
        //reader.Read();
        //lbEffDate.Text = reader["effectiveDate"].ToString();
        //reader.Read();
        //lbMaturDate.Text = reader["maturityDate"].ToString();
        //reader.Close();
        //con.Close();


       // string strConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
       // SqlConnection myConnection = new SqlConnection(strConnectionString);
       

       // try
       // {
       // myConnection = DBManager.getSqlConnection();
       // SqlCommand myCommandd = new SqlCommand("SELECT certNo, fName,lName,accountNo,accountType,DepositAmount,effectiveDate,tenors from FIXED_DEPOSIT", myConnection);
       // myConnection.Open();
  
       //lbCertNo.Text=("certNo").ToString();
       //lbName.Text=("fName + lName").ToString();
       //lbAccNo.Text=("accountNo").ToString();
       //lbAccType.Text=("accountType").ToString();
       //lbAmount.Text=("DepositAmount").ToString();
       //lbEffDate.Text=("effectiveDate").ToString();
       //lbMaturDate.Text=("tenors").ToString();

       // myCommandd.ExecuteNonQuery();

       // myConnection.Close();
       // }
       // catch (System.Data.SqlClient.SqlException ex)
       // {
       // Response.Write(ex);
       // }
       // finally
       // {
       // myConnection.Close();
       // }



    }
}


